TileLayer Pro palette file format v1.0 -------------------------------------- This text file has been created by creaothceann on Friday the 2007-03-09. This information comes from TileLayer Pro's help file and some reverse-engineering. The first 3 bytes of a TPL file are the signature; just keep it at 'TPL'. The next byte describes the format of the following palette data, which makes up the rest of the file. There must be enough data for 16, 32, 64, 128 or 256 palette entries. 'RGB' format is your common 8-bit palette file without padding, so 256 colors would be stored in 768 bytes. Values are 0..248. 'NES' format saves each color as a 6-bit value, just like it's used by the NES. Look further down to see what values are used by TileLayer Pro's conversion. And last but not least, the 'SNES' format is 2 bytes per palette entry, with 5 bits per color channel just like the SNES PPU2 uses it. offset | name | type | content ==========+=============+===============================+==================== 0 | Signature | Array[3] of Char | 'TPL' 3 | PalFormat | Byte | 0..2 4 | PalData | Array[FileSize - 4] of Byte | raw palette data PalFormat | palette entry | format ======================+=================+========================================= 0 = 'RGB' | 3 bytes | 8-bit RGB = bbbbbbbbggggggggrrrrrrrr 1 = 'NES' | 1 bytes | 6-bit NES = 00nnnnnn 2 = 'SNES/GBC/GBA' | 2 bytes | 15-bit RGB = 0bbbbbgggggrrrrr NES entry | R G B =============+=============== 00h | 112 112 112 01h | 032 024 136 02h | 000 000 168 03h | 064 000 152 04h | 136 000 112 05h | 168 000 016 06h | 160 000 000 07h | 120 008 000 08h | 064 040 000 09h | 000 064 000 0Ah | 000 080 000 0Bh | 000 056 016 0Ch | 024 056 088 0Dh | 000 000 000 0Eh | 000 000 000 0Fh | 000 000 000 10h | 184 184 184 11h | 000 112 232 12h | 032 056 232 13h | 128 000 240 14h | 184 000 184 15h | 224 000 088 16h | 216 040 000 17h | 200 072 008 18h | 136 112 000 19h | 000 144 000 1Ah | 000 168 000 1Bh | 000 144 056 1Ch | 000 128 136 1Dh | 000 000 000 1Eh | 000 000 000 1Fh | 000 000 000 20h | 248 248 248 21h | 056 184 248 22h | 088 144 248 23h | 160 136 248 24h | 240 120 248 25h | 248 112 176 26h | 248 112 096 27h | 248 152 056 28h | 240 184 056 29h | 128 208 016 2Ah | 072 216 072 2Bh | 088 248 152 2Ch | 000 232 216 2Dh | 000 000 000 2Eh | 000 000 000 2Fh | 000 000 000 30h | 248 248 248 31h | 168 224 248 32h | 192 208 248 33h | 208 200 248 34h | 248 192 248 35h | 248 192 216 36h | 248 184 176 37h | 248 216 168 38h | 248 224 160 39h | 224 248 160 3Ah | 168 240 184 3Bh | 176 248 200 3Ch | 152 248 240 3Dh | 000 000 000 3Eh | 000 000 000 3Fh | 000 000 000